﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WAD.WEB.AppCode;
using WAD.DAL;
using WAD.Model;

namespace QD.Weijie.Web.Passport
{
    public partial class A_List : PassportBase
    {
        protected int count = 0;
        protected string id, siteName,username;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsAgent())
                Echo("您不是代理商", "index.aspx");
         
            //BindData();
        }

        void BindData()
        {
            id = Parse.String("id");
            siteName = Parse.String("sitename");
            username = Parse.String("username");
            int page = Parse.Int("page", 1);
            string where = "agentid=" + user_id;
            PageData list = DAO.GetListPage("[id],name,nick_name,date,version_id,end_date", "id desc", page, 20, where, "[v_user_version]");
            count = list.itemCount;
            Repeater1.DataSource = list.table;
            Repeater1.DataBind();
        }

        protected string GroupTitle(object id)  
        {
            if (id == null || string.IsNullOrEmpty(id.ToString()))
                return "";
            return GetVersion(Convert.ToInt32(id));
        }

        protected string StatusTitle(object id)
        {
            return "";
        }
    }
}